package com.demo.linkList.singleLinkList;

public class Test {

    public static void main(String[] args) {
        SingleLinkList list = new SingleLinkList();
        list.addNode(new Node(1, "宋江", "呼保义"));
        list.addNode(new Node(7, "秦明", "霹雳火"));
        list.addNode(new Node(2, "卢俊义", "玉麒麟"));
        list.addNode(new Node(3, "吴用", "智多星"));
        list.addNode(new Node(6, "林冲", "豹子头"));
        list.addNode(new Node(4, "公孙胜", "入云龙"));
        list.addNode(new Node(5, "关胜", "大刀"));
        list.showLinkList();

//        System.out.println("------获取链表元素个数-------");
//        System.out.println(list.getListNodeConunt());

        /*System.out.println("---------获得倒数第{}个元素----------");
        System.out.println(list.getLastNode(list, 6));*/

        /*System.out.println("--------链表逆序--------");
        for (Integer i = 1; i <= list.getListNodeConunt(); i++) {
            System.out.println(list.getLastNode(list, i));
        }*/

        System.out.println("---------链表反转----------");
        list.getReverseList(list.getHead());
        list.showLinkList();

        /*SingleLinkList list1 = new SingleLinkList();
        list1.addSortNode(new Node(1, "宋江", "呼保义"));
        list1.addSortNode(new Node(7, "秦明", "霹雳火"));
        list1.addSortNode(new Node(2, "卢俊义", "玉麒麟"));
        list1.addSortNode(new Node(3, "吴用", "智多星"));
        list1.addSortNode(new Node(6, "林冲", "豹子头"));
        list1.addSortNode(new Node(4, "公孙胜", "入云龙"));
        list1.addSortNode(new Node(5, "关胜", "大刀"));
        list1.showLinkList();
        System.out.println("-----------------");

        list1.deleteNode(6);
        list1.deleteNode(9);

        list1.updateNode(new Node(8, "王明松", "松哥哥"));
        list1.showLinkList();*/
    }
}
